﻿using System.Collections.Generic;
using System.Collections.ObjectModel;
using HqlExample.Domain.Base;

namespace HqlExample.Domain.Entities
{
	public class Category : EntityBase<int>
	{
		private readonly IList<Item> items = new List<Item>();

		public virtual string Name { get; set; }

		public virtual ReadOnlyCollection<Item> Items
		{
			get { return new ReadOnlyCollection<Item>(items); }
		}

		public virtual void AddItems(Item pItem)
		{
			items.Add(pItem);
		}

		public virtual void RemoveItems(Item pItem)
		{
			items.Remove(pItem);
		}
	}
}